import UIAbility from '@ohos.app.ability.UIAbility';
import hilog from '@ohos.hilog';
import window from '@ohos.window';

export default class EntryAbility extends UIAbility {
  /*活动创建*/
  onCreate(want, launchParam) {
  }
  /*活动销毁*/
  onDestroy() {
  }

  /*窗口创建*/
  onWindowStageCreate(windowStage: window.WindowStage) {
    // Main window is created, set main page for this ability
    //全屏设置
    windowStage.getMainWindow((err, data) => {
      // 设置全屏展示，沉浸式
      data.setWindowLayoutFullScreen(true)

      /* 隐藏状态栏
      // 赋值给全局变量windowClass
      globalThis.windowClass = data
      // 隐藏状态栏显示
      globalThis.windowClass.setWindowSystemBarEnable(['navigation']);
      * */
    })
    // 加载页面
    windowStage.loadContent('Application', (err, data) => {
    })
  }
  /*窗口销毁*/
  onWindowStageDestroy() {
    // Main window is destroyed, release UI related resources
  }


  /*进入前台状态*/
  onForeground() {
    // Ability has brought to foreground
  }
  /*进入后台状态*/
  onBackground() {
    // Ability has back to background
  }
}
